<template>
  <div class="item" @click="goDetail">
    <div class="img-box">
      <img :src="item.bigPic || item.logo" alt="">
      <h4>{{item.name}}</h4>
    </div>
    <van-cell is-link v-if="isLink">
      <div slot="title">
        <span><van-icon name="chat-o" /> {{item.productCommentCount}}</span>&nbsp;&nbsp;
        <van-tag plain type="primary" v-if="item.factoryStatus===1">品牌商直供</van-tag>
      </div>
      <div slot="default">共 <span>{{item.productCount}}</span>件商品</div>
    </van-cell>
  </div>
</template>

<script>
export default {
  name:'BrandItem',
  props: {
    // 品牌详情
    item: {
      type: Object,
      default: ()=>({})
    },
    isLink:{
      type:[Boolean,String],
      default:false
    }
  },
  methods: {
    goDetail() {
      if(this.isLink)  this.$router.push('/brand/detail?id='+this.item.id)
    }
  },
}
</script>
<style lang="less" scoped>
.item{
  margin-bottom:20px;
  .img-box{
    height: 340px;
    position: relative;
    img{
      height: 340px;
      width: 100%;
    }
    h4{
      position: absolute;
      bottom: 0;
      left: 0;
      background-color: rgba(0,0,0,.5);
      width:100%;
      font-size: 28px;
      line-height: 60px;
      text-indent: 1em;
      color: #fff;
    } 
  }
}
</style>